<template>
	<view>
		<hx-navbar
		:back="true"
		:title="'横屏'"
		:fixed="true"
		:listenBack="true"
		@click-left="listenBack"
		/>
		<button type="default" @click="landscape">横屏</button>
		
		<button type="default" @click="unlockOrientation">竖屏</button>
		<view class="content">
			<h1>
				App操作参照
				https://www.html5plus.org/doc/zh_cn/device.html#plus.screen.lockOrientation
				html5plus标准开发
				
				
				问题解决，通过跳转空白页：https://ask.dcloud.net.cn/article/38151
				https://ask.dcloud.net.cn/question/99716
				
			</h1>
		</view>
	</view>
</template>
<script>
export default {
	components: {
	},
	data() {
		return {
			
		};
	},
	mounted() {
		plus.screen.lockOrientation("landscape-primary");  
	},
	//方法
	methods: {
		listenBack(){
			plus.screen.lockOrientation('portrait');
			uni.navigateTo({
				url: '../block/block'
			})
		},
		landscape(){
			plus.screen.lockOrientation('landscape-primary'); //锁定
		},
		unlockOrientation(){
			plus.screen.lockOrientation('portrait');
		}
	}
};
</script>
<style lang="scss" scoped>
</style>
